package net.zjitc.controller;

import net.zjitc.service.Impl.ServiceImpl;
import net.zjitc.service.Service;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by guo on 2017/11/12.
 */
@WebServlet(name = "DeleteCategoryServlet",urlPatterns = "/deleteCategoryServlet")
public class DeleteCategoryServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        int cid = Integer.valueOf(request.getParameter("cid"));
        Service service=new ServiceImpl();
        service.deleteCategory(cid);
        response.sendRedirect("categoryServlet");
    }
}
